<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>    
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>机构管理 </title>
 	<link href="css/bootstrap.min.css" rel="stylesheet">
    <!-- Data Tables -->
    <link href="css/plugins/dataTables/dataTables.bootstrap.css" rel="stylesheet">
    <link href="css/plugins/dataTables/dataTables.responsive.css" rel="stylesheet">
    <link href="css/plugins/dataTables/dataTables.tableTools.min.css" rel="stylesheet">
    <link href="css/animate.css" rel="stylesheet">
    <link href="css/style.css" rel="stylesheet">
    <link rel="stylesheet" type="text/css" href="css/css.css" />

<style type="text/css">
	
	button{
		border-radius:15px;
		font-size: 10px;
		color: #fff;
		background-color: #47a4e1;
		width:80px;
		height: 40px;	
		
	}
	
</style>

</head>
<body style="background-color:white">
	 <div class="pageTop" style="position:relative;height:50px">
            <div class="page">
                <img src="img/coin02.png" /><span><a href="main.do">首页</a>&nbsp;-&nbsp;-</span>&nbsp;机构管理
            </div>
     </div>
    <div class="row">
                <div class="col-lg-12">
                    <div class="ibox float-e-margins">
                        <div class="ibox-title">
							<button class="userbtn" style="left:50px" onclick="window.location.href='infomanageadd.do'">新增机构</button>&nbsp;&nbsp;&nbsp;							
							<button class="userbtn" style="left:200px" onclick="window.location.href='contact.do'">联系人</button>
                        </div>
                        <div class="ibox-content">
                            <table class="table table-striped table-bordered table-hover " id="editable">
                                    <thead>
                                    <tr >
                                        <th style="text-align:center">编号</th>
                                        <th style="text-align:center">机构名称</th>
                                        <th style="text-align:center">机构级别</th>
                                        <th style="text-align:center">省份/市</th>
                                        <th style="text-align:center">经办人</th>
                                        <th style="text-align:center">联系人</th>
                                        <th style="text-align:center">审核状态</th>
                                        <th style="text-align:center">操作</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <c:forEach items="${Organlist}" var="p">
                                    <tr class="gradeX" role="row">
                                        <td>${p.id }</td>
                                        <td>${p.name }</td>
										<td>
											<c:if test="${p.type==1}">政府</c:if>
											<c:if test="${p.type==2}">学校</c:if>
											<c:if test="${p.type==3}">企业</c:if>
											<c:if test="${p.type==4}">其他</c:if>
										</td>
										<td>${p.province} ${p.city}</td>
										<td>${p.contact.ename }</td>
										<td>${p.contact.name }</td>
										<td>
											<c:if test="${p.checkstate==0}">未审核</c:if>
											<c:if test="${p.checkstate==1}">已审核</c:if>
										</td>
										<td>
											<a href="infomanageupdate.do?id=${p.id }"><img class="operation" src="img/update.png"></a> 
											<a href="infomanagedetail.do?id=${p.id }"><img class="operation" src="img/view.png"></a>
											<a href="infodelbyid.do?id=${p.id }" onclick="if(confirm('确定删除?')==false)return false;"><img class="operation delban" src="img/delete.png" ></a>
											
										</td>	
                                    </tr>
			                           <!-- 删除弹出框 -->
										<%-- <div class="banDel" style="width:460px;height:350px;background-color:rgba(0, 0, 0, 0);margin-top:100px;margin-left:500px;padding:0;">
											<div class="delete"  style="width:460px;height:250px;margin:0;padding:0;border:2px solid rgba(0, 0, 0, 0.08);background-color:white">
												<div class="close">
													<a><img src="img/shanchu.png" /></a>
												</div>
												<p class="delP1" style="margin-top: 60px;">你确定要删除此条记录吗？</p>
												<p class="delP2">
													<a href="infodelbyid.do?id=${p.id }" class="ok yes">确定</a><a class="ok no">取消</a>
												</p>
											</div>
										</div> --%>
                                   	</c:forEach>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>

<!-- Mainly scripts -->
<script src="js/jquery-2.1.1.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/plugins/metisMenu/jquery.metisMenu.js"></script>
<script src="js/plugins/slimscroll/jquery.slimscroll.min.js"></script>

<!-- Data Tables -->
<script src="js/plugins/dataTables/jquery.dataTables.js"></script>
<script src="js/plugins/dataTables/dataTables.bootstrap.js"></script>
<script src="js/plugins/dataTables/dataTables.responsive.js"></script>


<!-- Custom and plugin javascript -->
<script src="js/inspinia.js"></script>


<!-- Page-Level Scripts -->
<script>
    $(document).ready(function () {
       

        /* Init DataTables */
        var oTable = $('#editable').dataTable();

        /* Apply the jEditable handlers to the table */
        oTable.$('td').editable('../example_ajax.php', {
            "callback": function (sValue, y) {
                var aPos = oTable.fnGetPosition(this);
                oTable.fnUpdate(sValue, aPos[0], aPos[1]);
            },
            "submitdata": function (value, settings) {
                return {
                    "row_id": this.parentNode.getAttribute('id'),
                    "column": oTable.fnGetPosition(this)[2]
                };
            },

            "width": "90%",
            "height": "100%"
        });

    })
    
    function fnClickAddRow() {
        $('#editable').dataTable().fnAddData([
            "Custom row",
            "New row",
            "New row",
            "New row",
            "New row"]);

    }
  

</script>

</body>
</html>